package org.kfive.nova.aop;

import org.apache.log4j.Logger;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * Created with IntelliJ IDEA.
 * User: admin
 * Date: 16-2-29
 * Time: 下午6:53
 * To change this template use File | Settings | File Templates.
 */
public class JDKManProxy implements InvocationHandler {

    private static Logger LOG = Logger.getLogger(JDKManProxy.class);

    private Object targetObject;

    public JDKManProxy(Object targetObject){
        this.targetObject = targetObject;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

        LOG.debug("before start sleep");
        method.invoke(targetObject,args);
        LOG.debug("after start sleep");
        return null;
    }
}
